package cn.javabb.framework.model;

import cn.javabb.framework.config.DataSourceConfig;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @desc:
 * @author: javabb (javabob(a)163.com)
 * @create: 2021/06/04 22:48
 */
@Data
public class GenConfig implements Serializable {
    // 数据源ID
    private Long dscId;

    private String projectId;

    private String projectName;

    private String groupId;

    private String author;

    private String packageName;

    private Long templateId;

    private Boolean needLog;

    private Boolean needPerm;

    private Boolean needSwagger;

    private Integer menuStartId;



    /**
     * 驱动连接的URL
     */
    private String url;
    /**
     * 驱动名称
     */
    private String driverName;
    /**
     * 数据库连接用户名
     */
    private String username;
    /**
     * 数据库连接密码
     */
    private String password;
    /**
     * 模块划分配置
     */
    private List<GenModel> models = new ArrayList<>();

    public DataSourceConfig getDsc() {
        DataSourceConfig dsc = DataSourceConfig.builder()
                .url(url)
                .driverName(driverName)
                .username(username)
                .password(password).build();
        return dsc;
    }

}
